
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第五章 循环结构 · C语言程序设计精髓程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="马小安">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chapter6.html" />
    
    
    <link rel="prev" href="chapter4.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.1.</b>
                    
                    笔记内容介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                        <b>1.2.</b>
                    
                    第一章 基础知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="chapter2.html">
            
                <a href="chapter2.html">
            
                    
                        <b>1.3.</b>
                    
                    第二章 数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="chapter3.html">
            
                <a href="chapter3.html">
            
                    
                        <b>1.4.</b>
                    
                    第三章 顺序结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="chapter4.html">
            
                <a href="chapter4.html">
            
                    
                        <b>1.5.</b>
                    
                    第四章 选择结构
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6" data-path="chapter5.html">
            
                <a href="chapter5.html">
            
                    
                        <b>1.6.</b>
                    
                    第五章 循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="chapter6.html">
            
                <a href="chapter6.html">
            
                    
                        <b>1.7.</b>
                    
                    第六章 数组概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="chapter7.html">
            
                <a href="chapter7.html">
            
                    
                        <b>1.8.</b>
                    
                    第七章 函数与预编译
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="chapter8_1.html">
            
                <a href="chapter8_1.html">
            
                    
                        <b>1.9.</b>
                    
                    第八章 指针类型(1)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="chapter8_2.html">
            
                <a href="chapter8_2.html">
            
                    
                        <b>1.10.</b>
                    
                    第八章 指针类型(2)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="chapter9_1.html">
            
                <a href="chapter9_1.html">
            
                    
                        <b>1.11.</b>
                    
                    第九章 结构体类型(1)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="chapter9_2.html">
            
                <a href="chapter9_2.html">
            
                    
                        <b>1.12.</b>
                    
                    第九章 结构体类型(2)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="chapter9_3.html">
            
                <a href="chapter9_3.html">
            
                    
                        <b>1.13.</b>
                    
                    第九章 结构体类型(3)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="chapter10.html">
            
                <a href="chapter10.html">
            
                    
                        <b>1.14.</b>
                    
                    第十章 位运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="chapter11.html">
            
                <a href="chapter11.html">
            
                    
                        <b>1.15.</b>
                    
                    第十一章 排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="Glossary.html">
            
                <a href="Glossary.html">
            
                    
                        <b>1.16.</b>
                    
                    其他资源
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第五章 循环结构</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5FAA;&#x73AF;&#x7ED3;&#x6784;">&#x5FAA;&#x73AF;&#x7ED3;&#x6784;</h1>
<h4 id="&#x5B9A;&#x4E49;&#xFF1A;&#x4ECE;main&#x5F00;&#x59CB;&#xFF0C;&#x4ECE;&#x4E0A;&#x5411;&#x4E0B;&#xFF0C;&#x4F7F;&#x5F97;&#x67D0;&#x4E9B;&#x8BED;&#x53E5;&#x91CD;&#x590D;&#x6267;&#x884C;">&#x5B9A;&#x4E49;&#xFF1A;&#x4ECE;main()&#x5F00;&#x59CB;&#xFF0C;&#x4ECE;&#x4E0A;&#x5411;&#x4E0B;&#xFF0C;&#x4F7F;&#x5F97;&#x67D0;&#x4E9B;&#x8BED;&#x53E5;&#x91CD;&#x590D;&#x6267;&#x884C;</h4>
<ul>
<li>&#x63A7;&#x5236;&#xFF08;&#x8868;&#x8FBE;&#x5F0F;&#xFF09;</li>
<li>&#x57FA;&#x7840;&#x8BED;&#x53E5;&#xFF08;&#x5FAA;&#x73AF;&#x4F53;&#xFF09;<h4 id="&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#x7684;&#x7A0B;&#x5E8F;&#xFF1A;&#x5728;&#x987A;&#x5E8F;&#x8BED;&#x53E5;&#x4E2D;&#x52A0;&#x5165;&#x5FAA;&#x73AF;&#x63A7;&#x5236;&#x8BED;&#x53E5;&#xFF08;31&#x4E2A;&#xFF09;">&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#x7684;&#x7A0B;&#x5E8F;&#xFF1A;&#x5728;&#x987A;&#x5E8F;&#x8BED;&#x53E5;&#x4E2D;&#x52A0;&#x5165;&#x5FAA;&#x73AF;&#x63A7;&#x5236;&#x8BED;&#x53E5;&#xFF08;3+1&#x4E2A;&#xFF09;</h4>
</li>
</ul>
<h4 id="&#x5FAA;&#x73AF;&#x63A7;&#x5236;&#x8BED;&#x53E5;&#x5F00;&#x5173;">&#x5FAA;&#x73AF;&#x63A7;&#x5236;&#x8BED;&#x53E5;(&#x5F00;&#x5173;)</h4>
<ol>
<li><p>==&#x65B9;&#x5F0F;1&#xFF1A;while(&#x8868;&#x8FBE;&#x5F0F;){&#x5FAA;&#x73AF;&#x4F53;&#x8BED;&#x53E5;&#x5E8F;&#x5217;;}==</p>
<ol>
<li>while&#x8BED;&#x53E5;&#xFF08;&#x5F53;&#x578B;&#x5FAA;&#x73AF;&#xFF09;{&#x5FAA;&#x73AF;&#x4F53;&#x8BED;&#x53E5;&#x5E8F;&#x5217;;} &#x540E;&#x7EE7;&#x8BED;&#x53E5;</li>
<li>while&#x6574;&#x4F53;&#x4E3A;&#x4E00;&#x6761;&#x63A7;&#x5236;&#x8BED;&#x53E5;&#xFF0C;&#x6CE8;&#x610F;&#x6267;&#x884C;&#x8FC7;&#x7A0B;</li>
<li>while&#x540E;&#x9762;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#x9700;&#x8981;&#x52A0;&#x5C0F;&#x62EC;&#x53F7;</li>
<li>while&#x63A7;&#x5236;&#x4E00;&#x6761;&#x8BED;&#x53E5;(&#x590D;&#x5408;&#x8BED;&#x53E5;)</li>
<li>&#x590D;&#x5408;&#x8BED;&#x53E5;&#x7B97;&#x4E00;&#x6761;&#x8BED;&#x53E5;</li>
<li>&#x6709;&#x53EF;&#x80FD;&#x4E00;&#x6B21;&#x90FD;&#x4E0D;&#x6267;&#x884C;&#xFF08;0&#x6B21;&#x6216;&#x8005;0&#x6B21;&#x4EE5;&#x4E0A;&#xFF09;</li>
<li>&#x5916;&#x9762;&#x6709;&#x521D;&#x59CB;&#x503C;&#xFF0C;&#x62EC;&#x53F7;&#x5185;&#x6709;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x5FAA;&#x73AF;&#x4F53;&#x6709;&#x589E;&#x91CF;&#x3002;</li>
</ol>
</li>
<li><p>==&#x65B9;&#x5F0F;2&#xFF1A;do&#x2014;while&#x5FAA;&#x73AF;&#xFF08;&#x76F4;&#x5230;&#x578B;&#x5FAA;&#x73AF;==&#xFF09;</p>
<ol>
<li>do{&#x5FAA;&#x73AF;&#x4F53;&#x8BED;&#x53E5;&#x5E8F;&#x5217;&#xFF1B;}while(&#x8868;&#x8FBE;&#x5F0F;);&#x540E;&#x7EED;&#x8BED;&#x53E5;</li>
<li>while&#x52A0;&#x62EC;&#x53F7;&#xFF0C;&#x540E;&#x9762;&#x6709;&#x5206;&#x53F7;&#x3002;</li>
<li>do&#x4E0D;&#x80FD;&#x5355;&#x72EC;&#x51FA;&#x73B0;&#xFF0C;&#xFF08;else&#x4E5F;&#x4E0D;&#x80FD;&#x5355;&#x72EC;&#x51FA;&#x73B0;&#xFF09;</li>
<li>do&#x53EA;&#x80FD;&#x5C31;&#x8FD1;&#x63A7;&#x5236;&#x4E00;&#x6761;&#xFF0C;&#x5982;&#x679C;&#x591A;&#x6761;&#xFF0C;&#x4E00;&#x5B9A;&#x9700;&#x8981;&#x52A0;&#x82B1;&#x62EC;&#x53F7;{},</li>
<li>&#x81F3;&#x5C11;&#x6267;&#x884C;&#x4E00;&#x6B21;&#xFF08;1&#x6B21;&#x6216;&#x8005;&#x4E00;&#x6B21;&#x4EE5;&#x4E0A;</li>
<li>do while&#x4E4B;&#x95F4;&#x4E0D;&#x80FD;&#x6709;&#x7B2C;&#x4E09;&#x8005;&#xFF08;&#x5FC5;&#x987B;&#x52A0;&#x82B1;&#x62EC;&#x53F7;&#xFF09;</li>
</ol>
</li>
<li><p>==&#x65B9;&#x5F0F;3&#xFF1A;for(;;){&#x5FAA;&#x73AF;&#x4F53;&#x8BED;&#x53E5;&#x5E8F;&#x5217;;}==</p>
<ol>
<li>for(expr1;expr2;expr3){&#x5FAA;&#x73AF;&#x4F53;&#x8BED;&#x53E5;&#xFF1B;} </li>
<li>&#x4E09;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x4E24;&#x4E2A;&#x5206;&#x53F7;</li>
<li>&#x6267;&#x884C;&#x8FC7;&#x7A0B;&#xFF1A;&#x5148;&#x8BA1;&#x7B97;&#x8868;&#x8FBE;&#x5F0F;1&#xFF0C;&#x7136;&#x540E;&#x8BA1;&#x7B97;&#x8868;&#x8FBE;&#x5F0F;2(0&#x6216;&#x8005;1)&#xFF0C; &#x5982;&#x679C;&#x662F;&#x975E;0&#x6267;&#x884C;&#x5FAA;&#x73AF;&#x4F53;&#xFF0C;&#x7136;&#x540E;&#x8FD4;&#x56DE;&#x8868;&#x8FBE;&#x5F0F;3&#xFF0C;&#x8868;&#x8FBE;&#x5F0F;3&#x8FD0;&#x7B97;&#x4E4B;&#x540E;&#x3002;&#x7136;&#x540E;&#x8FD4;&#x56DE;&#x8868;&#x8FBE;&#x5F0F;2&#xFF0C;&#x7EE7;&#x7EED;&#x5224;&#x65AD;&#xFF1B;&#x5982;&#x679C;&#x8868;&#x8FBE;&#x5F0F;&#x6761;&#x4EF6;&#x4E3A;&#x5047;&#xFF0C;&#x9000;&#x51FA;&#x5FAA;&#x73AF;&#x4F53;</li>
<li>&#x8868;&#x8FBE;&#x5F0F;1&#x503C;&#x53EA;&#x6267;&#x884C;&#x4E00;&#x6B21;&#xFF0C;&#x521D;&#x59CB;&#x5316;&#x6761;&#x4EF6;</li>
<li>&#x8868;&#x8FBE;&#x5F0F;2&#x662F;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#xFF0C;&#x8FD4;&#x56DE;0&#x6216;&#x8005;&#x975E;0</li>
<li>&#x8868;&#x8FBE;&#x5F0F;3&#x662F;&#x589E;&#x91CF;&#x5F0F;&#xFF0C;&#x5F71;&#x54CD;&#x8868;&#x8FBE;&#x5F0F;2&#x7684;&#x7ED3;&#x679C;&#xFF0C;</li>
<li>&#x5982;&#x679C;&#x8868;&#x8FBE;&#x5F0F;2&#x6C38;&#x4E3A;&#x771F;&#xFF0C;&#x5219;&#x4E3A;&#x6B7B;&#x5FAA;&#x73AF;</li>
<li>for&#x4E2D;&#x7684;&#x4E24;&#x4E2A;&#x5206;&#x53F7;&#x4E0D;&#x80FD;&#x5C11;</li>
<li>&#x5982;&#x679C;for&#x8868;&#x8FBE;&#x5F0F;2&#x7F3A;&#x5C11;&#x7684;&#x8BDD;&#xFF0C;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;1&#xFF0C;&#x6C38;&#x4E3A;&#x771F;&#x3002;</li>
<li>expr1&#x8BFE;&#x653E;&#x5728;for&#x4E4B;&#x524D;&#xFF0C;expr3&#x53EF;&#x4EE5;&#x653E;&#x5728;&#x5FAA;&#x73AF;&#x4F53;&#x5185;</li>
<li>&#x7ECF;&#x5178;&#x4E3E;&#x4F8B;<ol>
<li>for(i=1;i++&lt;4;);Q&#xFF1A;&#x5FAA;&#x73AF;&#x4F53;&#x6267;&#x884C;&#x51E0;&#x6B21;&#xFF1F;&#x540E;&#x7EE7;&#x8BED;&#x53E5;&#x7684;i&#x7B49;&#x4E8E;&#x591A;&#x5C11;&#xFF1F;</li>
<li>for(i=1,++i&lt;4;i++);&#x5FAA;&#x73AF;&#x4F53;&#x6267;&#x884C;&#x51E0;&#x6B21;&#xFF1F;&#x540E;&#x7EE7;&#x8BED;&#x53E5;&#x7684;i&#x7B49;&#x4E8E;&#x591A;&#x5C11;&#xFF1F;</li>
<li>A&#xFF1A;(1)&#x5FAA;&#x73AF;3&#x6B21;&#xFF0C;i = 5&#xFF1B;(2)&#x5FAA;&#x73AF;&#x4E00;&#x6B21;&#xFF0C;i = 4</li>
</ol>
</li>
</ol>
</li>
<li><p>==&#x65B9;&#x5F0F;4&#xFF1A;if(){}else{} &#x4E0E;goto&#x914D;&#x5408;&#x4F7F;&#x7528;&#x3002;==</p>
<ol>
<li><pre class="language-"><code>sum4() {
 int i = 1, sum = 0;

SUM:sum += i; //&#x5206;&#x53F7;&#x51B3;&#x5B9A;&#x4E86;sum&#x662F;&#x4E2A;&#x6807;&#x53F7;
 i++;
 if (i &lt;= 100) goto SUM;

 printf(&quot;sum4&#xFF1A;%d&quot;, sum);
}
</code></pre></li>
</ol>
</li>
<li>==&#x53CC;&#x5FAA;&#x73AF;&#x7ED3;&#x6784;==<ol>
<li>&#x53CC;&#x5FAA;&#x73AF;&#x5F00;&#x59CB;&#x4E8E;&#x5916;&#x5FAA;&#x73AF;&#xFF1B;</li>
<li>&#x5FAA;&#x73AF;&#x7531;&#x5916;&#x5411;&#x5185;</li>
<li>&#x5BF9;&#x4E8E;&#x5916;&#x5FAA;&#x73AF;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#xFF0C;&#x5185;&#x5FAA;&#x73AF;&#x90FD;&#x8981;&#x8DD1;&#x4E00;&#x5708;&#xFF0C;&#x5373;&#x77E5;&#x9053;&#x5185;&#x5FAA;&#x73AF;&#x7684;&#x6761;&#x4EF6;&#x4E3A;&#x5047;</li>
<li>&#x5185;&#x5FAA;&#x73AF;&#x7ED3;&#x675F;&#x4E4B;&#x540E;&#x56DE;&#x5230;&#x5916;&#x5FAA;&#x73AF;&#x7684;&#x8868;&#x8FBE;&#x5F0F;</li>
<li>&#x5F53;&#x5185;&#x3001;&#x5916;&#x5FAA;&#x73AF;&#x90FD;&#x7ED3;&#x675F;&#x65F6;&#xFF0C;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x90FD;&#x4E3A;&#x5047;&#xFF0C;&#x9000;&#x51FA;&#x5185;&#x5916;&#x5FAA;&#x73AF;&#x3002;</li>
</ol>
</li>
</ol>
<pre class="language-"><code>//&#x8F97;&#x8F6C;&#x76F8;&#x51CF;&#x6CD5;&#x6C42;&#x6700;&#x5927;&#x516C;&#x7EA6;&#x6570;&#xFF08;&#x7B97;&#x6CD5;&#xFF09;
while_loop() {
    int m, n;   //&#x8BED;&#x53E5;1

    printf(&quot;enter m, n:&gt;&quot;); //&#x8BED;&#x53E5;2
    scanf(&quot;%d%d&quot;, &amp;m, &amp;n);  //&#x8BED;&#x53E5;3

    while (m != n) {        //&#x8BED;&#x53E5;4&#xFF0C;&#x53CC;&#x5FAA;&#x73AF;&#x7ED3;&#x6784;
        while (m &gt; n)
        {
            m -= n;
        }
        while (n &gt; m) 
        { 
            n -= m; 
        }
    }
    printf(&quot;m=%d\n&quot;, m);    //&#x8BED;&#x53E5;5
}
</code></pre><h2 id="&#x63A7;&#x5236;&#x8BED;&#x53E5;">&#x63A7;&#x5236;&#x8BED;&#x53E5;</h2>
<ol>
<li><p>break</p>
<ol>
<li>&#x683C;&#x5F0F;&#xFF1A;break;</li>
<li>&#x529F;&#x80FD;&#xFF1A;&#x4E2D;&#x6B62;&#x9000;&#x51FA;&#xFF0C;&#x8DF3;&#x51FA;&#x8BED;&#x53E5;</li>
<li>&#x8303;&#x56F4;&#xFF1A;&#x5FAA;&#x73AF;&#x4F53;&#x4E2D;&#xFF0C;switch&#x7684;case&#x8BED;&#x53E5;&#x4E2D;&#x3002;</li>
<li>&#x5907;&#x6CE8;&#xFF1A;&#x5FAA;&#x73AF;&#x4F53;&#x7ED3;&#x675F;&#x7684;&#x65B9;&#x5F0F;&#x6709;&#x4E24;&#x79CD;&#xFF0C;&#x2460;&#x8868;&#x8FBE;&#x5F0F;&#x6761;&#x4EF6;&#x4E3A;&#x5047;&#xFF1B;&#x2461;break&#x8BED;&#x53E5;&#x3002;</li>
</ol>
</li>
<li><p>continue</p>
<ol>
<li>&#x683C;&#x5F0F;&#xFF1A;continue&#xFF1B;</li>
<li>&#x529F;&#x80FD;&#xFF1A;&#x7ED3;&#x675F;&#x4E00;&#x6B21;&#x5FAA;&#x73AF;&#x7EE7;&#x7EED;&#xFF0C;&#x8DF3;&#x56DE;</li>
<li>&#x8303;&#x56F4;&#xFF1A;&#x53EA;&#x80FD;&#x7528;&#x4E8E;&#x5FAA;&#x73AF;&#x4F53;&#x4E2D;&#x3002;</li>
<li>&#x6CE8;&#xFF1A;&#x7528;&#x4E8E;for&#x5FAA;&#x73AF;&#x4F53;&#x65F6;&#xFF0C;continue&#x5C06;&#x8DF3;&#x56DE;&#x8868;&#x8FBE;&#x5F0F;3&#xFF0C;&#x7528;&#x4E8E;while/do...while&#x65F6;&#xFF0C;&#x8DF3;&#x56DE;while&#x540E;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#x3002;</li>
<li>&#x4EE3;&#x7801;&#x8303;&#x4F8B;&#xFF1A;
```</li>
</ol>
</li>
</ol>
<p>for(i=1;i&lt;4;i++)
{
    int i;
    i++;
    continue;
}
printf(&quot;&amp;d&quot;,i);</p>
<p>```</p>
<h3 id="&#x4F8B;&#x9898;&#x5206;&#x6790;">&#x4F8B;&#x9898;&#x5206;&#x6790;</h3>
<ol>
<li>for(x=0,y=0;y!=250 || x &lt;4;x++) y+=50;&#x6C42;&#x5FAA;&#x73AF;&#x6B21;&#x6570;&#xFF08;&#x7B54;&#x6848;&#x4E3A;5&#xFF09;</li>
<li></li>
</ol>
<h5 id="&#x63A7;&#x5236;&#x8BED;&#x53E5;&#xFF1A;do&#x3002;&#x3002;&#x3002;while&#x3001;while&#x3001;else&#x3001;if&#x3001;switch&#x3001;for">&#x63A7;&#x5236;&#x8BED;&#x53E5;&#xFF1A;do&#x3002;&#x3002;&#x3002;while&#x3001;while&#x3001;else&#x3001;if&#x3001;switch&#x3001;for</h5>
<h3 id="c&#x8BED;&#x8A00;&#x516D;&#x5927;&#x5668;">C&#x8BED;&#x8A00;&#x516D;&#x5927;&#x5668;</h3>
<ul>
<li>&#x7D2F;&#x52A0;&#x5668;&#xFF08;==&#x7D2F;&#x52A0;&#x53D8;&#x91CF;&#x9700;&#x8981;&#x521D;&#x59CB;&#x5316;==&#xFF0C;&#x5982;int, sum = 0&#xFF1B;sum += i&#xFF1B;&#xFF09;</li>
<li>&#x7D2F;&#x4E58;&#x5668;&#xFF08;&#x7D2F;&#x52A0;&#x53D8;&#x91CF;&#x9700;&#x8981;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x5982;int, sum = 1&#xFF1B;sum *= i&#xFF1B;&#xFF09;</li>
<li>&#x8BA1;&#x6570;&#x5668;</li>
<li>&#x6700;&#x5927;&#x5668;</li>
<li>&#x6700;&#x5C0F;&#x5668;</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="chapter4.html" class="navigation navigation-prev " aria-label="Previous page: 第四章 选择结构">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="chapter6.html" class="navigation navigation-next " aria-label="Next page: 第六章 数组概念">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第五章 循环结构","level":"1.6","depth":1,"next":{"title":"第六章 数组概念","level":"1.7","depth":1,"path":"chapter6.md","ref":"chapter6.md","articles":[]},"previous":{"title":"第四章 选择结构","level":"1.5","depth":1,"path":"chapter4.md","ref":"chapter4.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","highlight","-livereload","search-plus@^0.0.11","disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","emphasize@^1.1.0","katex@^1.1.3","splitter@^0.0.8","terminal@^0.3.2","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"emphasize":{},"splitter":{},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"prism-themes":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"search-plus":{}},"theme":"default","author":"马小安","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"C语言程序设计精髓程","language":"zh-hans","gitbook":"*","description":"苏小红(哈工大)"},"file":{"path":"chapter5.md","mtime":"2018-01-31T01:17:29.879Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-01-31T05:09:23.850Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

